# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=picat
pkgver=3.6.6
_pkgver="${pkgver//./}"
pkgrel=0
pkgdesc="Logic-based multi-paradigm programming language"
url="http://picat-lang.org/"
arch="all"
license="MPL-2.0"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://picat-lang.org/download/picat${_pkgver}_src.tar.gz
	fix-fileno-usage.patch
	"
builddir="$srcdir/Picat/emu"

build() {
	make -f Makefile.linux64
}

check() {
	./picat --version
}

package() {
	local extdir="$srcdir"/Picat

	install -Dvm755 picat -t "$pkgdir"/usr/bin/

	install -Dvm644 "$extdir"/lib/* \
		-t "$pkgdir"/usr/lib/$pkgname

	install -Dvm644 "$extdir"/README \
		"$extdir"/LICENSE "$extdir"/doc/* \
		-t "$pkgdir"/usr/share/doc/$pkgname

	cp -va "$extdir"/exs \
		"$pkgdir"/usr/share/doc/$pkgname/examples
}

sha512sums="
d8548ee12719c6886e09ba1734d2348a289b154d1dd49d8e2549ac0280874b4aff674c8262e975451fdd6441bc0dd0aead7ebc719c1d094bba0b28f7c93a485e  picat-3.6.6.tar.gz
2dba3365496fd363159adae5a320ee876475bdc02d04b4edb18ceb4bc5fffb5a145ad9bc07c6c17e928e50fa57b6324feb3993a751a1647542a55baf054f1cdf  fix-fileno-usage.patch
"
